forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: follower node sync from DA #631
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NazariiDenha
changed the title
implement l1rpcfetcher and prepare for implementing da_syncer
implement l1rpcfetcher and da_syncer
Feb 13, 2024
vyzo
reviewed
Feb 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first pass generally looks ok, left some comments.
I will do another pass later.
…t/sync-directly-from-da
…t/sync-directly-from-da
NazariiDenha
changed the title
implement l1rpcfetcher and da_syncer
DON'T MERGE: follower node sync from DA(L1)
Apr 30, 2024
…t/sync-directly-from-da
…o-ethereum into feat/sync-directly-from-da
…o-ethereum into feat/sync-directly-from-da
…t/sync-directly-from-da
jonastheis
previously approved these changes
Aug 8, 2024
…y so that they can be retried in pipeline
jonastheis
force-pushed
the
feat/sync-directly-from-da
branch
from
August 13, 2024 04:35
8f1f6b7
to
399dcfc
Compare
0xmountaintop
previously approved these changes
Aug 14, 2024
0xmountaintop
previously approved these changes
Aug 17, 2024
* support beacon node client as blob provider * fix * fix formatting * use url.JoinPath instead of path * don't move pos each time in blob_client_list --------- Co-authored-by: jonastheis <[email protected]>
jonastheis
added a commit
that referenced
this pull request
Aug 29, 2024
Conflicts: cmd/geth/main.go core/state_processor_test.go core/txpool/legacypool/legacypool.go eth/backend.go eth/ethconfig/config.go eth/gasprice/gasprice_test.go eth/handler.go eth/protocols/eth/broadcast.go eth/protocols/eth/handlers.go go.mod go.sum miner/miner.go miner/miner_test.go miner/scroll_worker.go miner/scroll_worker_test.go params/config.go params/version.go rollup/rollup_sync_service/rollup_sync_service_test.go
13 tasks
colinlyguo
reviewed
Sep 11, 2024
colinlyguo
reviewed
Sep 17, 2024
colinlyguo
reviewed
Sep 17, 2024
colinlyguo
reviewed
Sep 17, 2024
Closing this PR as it is superseded by #1013 which is based on the new base branch |
jonastheis
added a commit
that referenced
this pull request
Oct 16, 2024
) * feat: follower node sync from DA #631 Conflicts: cmd/geth/main.go core/state_processor_test.go core/txpool/legacypool/legacypool.go eth/backend.go eth/ethconfig/config.go eth/gasprice/gasprice_test.go eth/handler.go eth/protocols/eth/broadcast.go eth/protocols/eth/handlers.go go.mod go.sum miner/miner.go miner/miner_test.go miner/scroll_worker.go miner/scroll_worker_test.go params/config.go params/version.go rollup/rollup_sync_service/rollup_sync_service_test.go * fixes after merge * fix: panic after startup due to misconfigured api * fix bug of not calculating block state root * minor adjustment of fix * address review comments * upgrade da-codec to scroll-tech/da-codec@41c6486 * fix go.mod after merge * fix some tests --------- Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: 0xmountaintop <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. Purpose or design rationale of this PR
This PR implements a
follower node from DA/L1
mode which reproduces the L2 state solely from L1 events and loading data from DA (calldata is retrieved from L1 RPC directly, historical blobs are loaded via beacon node or blob APIs and verified viaversionedHash
).On a high level, it works as follows: the L2 functionality of the node is disabled and instead it connects only to the configured L1 RPC, retrieves all rollup events (commit batch, revert, finalize), L1 messages and batch data (i.e. calldata or blobs since Bernoulli). Once an event is finalized on L1 the resulting state (meaning L2 state and blocks) are derived and verified from this data.
The derivation process works by implementing a pipeline with following steps:
-
DAQueue
: usesDataSource
to retrieve events and corresponding data (calldata or blob).-
BatchQueue
: sorts differentDATypes
and returns committed, finalized batches in order.-
BlockQueue
: converts batches toPartialBlocks
that can be used to create the L2 state-
DASyncer
: executesPartialBlock
and inserts into chainHow to run?
Run
l2geth
with the--da.sync
flag and provide blob APIs with e.g.--da.blob.blobscan=https://api.blobscan.com/blobs/
--da.blob.blocknative=https://api.ethernow.xyz/v1/blob/
for mainnet and--da.blob.blobscan=https://api.sepolia.blobscan.com/blobs/
for Sepolia.A full sync will take about ~2 days depending on the speed of the RPC node and the local machine. Progess is reported as follows for every 1000 blocks applied:
INFO [08-01|16:44:42.173] L1 sync progress blockhain height=87000 block hash=608eec..880ebd root=218215..9a58a2
Limitations
The
state root
of a block can be reproduced when using this mode of syncing but currently not theblock hash
. This is due to the fact that currently the header fieldsdifficulty
andextraData
are not stored on DA but these fields are utilized by Clique consensus which is used by the Scroll protocol. This will be fixed in a future upgrade where the main implementation on l2geth is already done: #903 #913.To verify the locally created
state root
against mainnet, we can do the following:By comparing the headers we can most importantly see that
state root
,receiptsRoot
and everything that has to do with the state matches. However, the following fields will be different:difficulty
and thereforetotalDifficulty
extraData
size
due to differences in header sizehash
and thereforeparentHash
Example local output for block 11000:
Example remote output:
2. PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
3. Deployment tag versioning
Has the version in
params/version.go
been updated?4. Breaking change label
Does this PR have the
breaking-change
label?